package com.fr.report.script.core.parser;

import com.fr.base.ColumnRow;
import java.io.Serializable;

public class LocationDim
  implements Cloneable, Serializable
{
  public static final byte ABSOLUTE = 0;
  public static final byte PLUS = 1;
  public static final byte MINUS = 2;
  private ColumnRow columnrow;
  private int index;
  private byte op;

  public LocationDim(ColumnRow paramColumnRow, byte paramByte, int paramInt)
  {
    this.columnrow = paramColumnRow;
    this.op = paramByte;
    this.index = paramInt;
  }

  public ColumnRow getColumnrow()
  {
    return this.columnrow;
  }

  public void setIndex(int paramInt)
  {
    this.index = paramInt;
  }

  public int getIndex()
  {
    return this.index;
  }

  public byte getOp()
  {
    return this.op;
  }

  public String toString()
  {
    return this.columnrow + ":" + ((this.op == 2) ? "-" : (this.op == 1) ? "+" : "!") + this.index;
  }

  public void changeColumnRow(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    int i = this.columnrow.getColumn();
    if ((paramInt3 != -1) && (this.columnrow.getColumn() >= paramInt3))
      i += paramInt4;
    int j = this.columnrow.getRow();
    if ((paramInt1 != -1) && (this.columnrow.getRow() >= paramInt1))
      j += paramInt2;
    this.columnrow = ColumnRow.valueOf(i, j);
  }
}